package com.fancy.learncenter.net;

import com.fancy.learncenter.bean.BaseBean;
import com.fancy.learncenter.bean.CartoonStudentStatisBean;
import com.fancy.learncenter.bean.CartoonWorkUnitBean;

import org.json.JSONObject;
import org.json.JSONStringer;

import java.util.Map;

import okhttp3.MultipartBody;
import okhttp3.Request;
import okhttp3.RequestBody;
import okhttp3.ResponseBody;
import retrofit2.Call;
import retrofit2.Response;
import retrofit2.http.Body;
import retrofit2.http.FieldMap;
import retrofit2.http.FormUrlEncoded;
import retrofit2.http.GET;
import retrofit2.http.Header;
import retrofit2.http.Headers;
import retrofit2.http.Multipart;
import retrofit2.http.POST;
import retrofit2.http.Part;
import retrofit2.http.PartMap;
import retrofit2.http.Query;
import retrofit2.http.QueryMap;
import retrofit2.http.Url;
import rx.Observable;

/**
 * Created by Hyy on 2016/9/29.
 */
public interface ApiService {
    @POST("check/testRetrofit.json")
    Observable<Response<ResponseBody>> testRetrofit(@Header("header") String header, @Query("body") String body);

    @GET("rct/getHomePageInfo.json")
    Observable<Response<ResponseBody>> getHomeBookStore();

    @GET("check/test.json")
    Observable<Response<ResponseBody>> test(@Query("header") String header);

    @GET("show/recommend.json ")
    Observable<Response<ResponseBody>> getShowListData(@QueryMap Map<String, Object> paramerMap);

    @GET("show/getCategory.json")
    Observable<Response<ResponseBody>> getShowBanner(@QueryMap Map<String, Object> paramerMap);

    @GET("show/list.json ")
    Observable<Response<ResponseBody>> getShowCategoryListData(@QueryMap Map<String, Object> paramerMap);

    @GET("home/listBanner.json")
    Observable<Response<ResponseBody>> getNGKBanner();

    @POST("home/listRecommend.json")
    Observable<Response<ResponseBody>> getNGKList(@QueryMap Map<String, Object> paramerMap);

    @Multipart
    @POST("show/record/submit.json")
    Observable<Response<ResponseBody>> upAudio(@Part("file\"; filename=\"av.mp3") RequestBody file, @QueryMap Map<String, Object> paramerMap);

    @Multipart
    @POST("show/record/submit.json")
    Observable<Response<ResponseBody>> upAudio(@PartMap Map<String, RequestBody> params, @QueryMap Map<String, Object> paramerMap);

    @POST
    @Multipart
    Call<Response<ResponseBody>> uploadFile();

    @POST("my/listAllAudio.json")
    Observable<Response<ResponseBody>> getOnlineRecorderAudio(@QueryMap Map<String, Object> paramerMap);

    @GET("login/getLoginPwdToken.do")
    Observable<Response<ResponseBody>> getToken();

    @GET("login/jsonRegister.do")
    Observable<Response<ResponseBody>> regist(@QueryMap Map<String, Object> paramerMap);

    @POST("login/ucSendRegisterVerifyCode.do")
    Observable<Response<ResponseBody>> getRegsiterCode(@Query("mobile") String mobile);

    @POST("login/jsonLogin.do")
    Observable<Response<ResponseBody>> login(@QueryMap Map<String, Object> paramerMap);

    @POST("logout.do")
    Observable<Response<ResponseBody>> loginOut();

    @POST("login/findPwd.json")
    Observable<Response<ResponseBody>> findPWD(@QueryMap Map<String, Object> paramerMap);


    @POST("login/ucSendResetPwdVerifyCode.do")
    Observable<Response<ResponseBody>> getPWDCode(@Query("mobile") String mobile);


    @GET("show/detail.json")
    Observable<Response<ResponseBody>> getMedioDetail(@Query("id") int id);


    @POST("signup/getSignupDetail.json")
    Observable<Response<ResponseBody>> getCourseDeatailData(@Query("lessonSchoolDetailId") long lessonSchoolDetailId);

    @POST("pay/getAppPayResquestData.json")
    Observable<Response<ResponseBody>> getPayData(@QueryMap Map<String, Object> paramerMap);


    @FormUrlEncoded
    @POST("homework/objectQuestion/urgeStudentHomework.json")
    Observable<Response<ResponseBody>> urgeStudentHomework(@FieldMap Map<String, Object> paramerMap);


    @POST("lesson/listLessonAndCategory.json")
    Observable<Response<ResponseBody>> getCourseData(@Query("lessonType") int lessonType);

    @POST("signup/getSignupDetail.json")
    Observable<Response<ResponseBody>> getCourseSignupData(@Query("lessonSchoolDetailId") long lessonSchoolDetailId);

    @Multipart
    @POST("mysetting/uploadUserHeaderImage.json")
    Observable<Response<ResponseBody>> upHeaderIcon(@PartMap Map<String, RequestBody> params);

    @Multipart
    @POST("homework/class/uploadClassHeaderImage.json")
    Observable<Response<ResponseBody>> uploadClassHeaderImage(@PartMap Map<String, RequestBody> params);


    @POST("mySetting/changeNickname.json")
    Observable<Response<ResponseBody>> setName(@Query("nickname") String nickname);

    @POST("mySchool/mySchoolDetail.json")
    Observable<Response<ResponseBody>> getMySchoolDeatail();

    @POST("my/listAllCollection.json")
    Observable<Response<ResponseBody>> getMyCollection(@Query("customerId") long customerId, @Query("type") int type);

    @POST("mySchool/listAllCity.json")
    Observable<Response<ResponseBody>> getAllCity();

    @POST("mySchool/listAllSchoolArea.json")
    Observable<Response<ResponseBody>> getAllSchool(@QueryMap Map<String, Object> params);

    @POST("mySchool/bindingSchool.json")
    Observable<Response<ResponseBody>> bindSchool(@Query("schoolId") long schoolId);

    @POST("mySchool/deBindingSchool.json")
    Observable<Response<ResponseBody>> deBindSchool(@Query("schoolId") long schoolId);

    @POST("my/listAllMessage.json")
    Observable<Response<ResponseBody>> getAllMessage();

    @POST("my/getUnReadMessageCount.json")
    Observable<Response<ResponseBody>> getUnMessage();

    @POST("praise/addPraiseRecord.json")
    Observable<Response<ResponseBody>> addPraiseNum(@QueryMap Map<String, Object> params);

    @POST("praise/getPraiseRecord.json")
    Observable<Response<ResponseBody>> getPraiseNum(@QueryMap Map<String, Object> params);

    @POST("comment/listAllComments.json")
    Observable<Response<ResponseBody>> getDiscuss(@QueryMap Map<String, Object> params);

    @POST("lesson/getLessonCategory.json")
    Observable<Response<ResponseBody>> getSchool();

    @POST("lesson/listAllLessonDetail.json")
    Observable<Response<ResponseBody>> getAllLesson(@QueryMap Map<String, Object> params);

    @POST("my/changeReadState.json")
    Observable<Response<ResponseBody>> changeReadState(@QueryMap Map<String, Object> params);

    @POST("comment/addComment.json")
    Observable<Response<ResponseBody>> addComment(@QueryMap Map<String, Object> params);

    @POST("pageview/addPageviews.json")
    Observable<Response<ResponseBody>> addPv(@QueryMap Map<String, Object> params);

    @POST("share/getShareInfo.json")
    Observable<Response<ResponseBody>> getShareData(@QueryMap Map<String, Object> params);

    @POST("show/detail.json")
    Observable<Response<ResponseBody>> getShowDetail(@QueryMap Map<String, Object> params);

    @POST("qrcode/getFangcyIdByCustomerId")
    Observable<Response<ResponseBody>> getQRCode();

    @POST("my/customerServiceInfo.json")
    Observable<Response<ResponseBody>> getService();

    @POST("home/isNeedUpdate.json")
    Observable<Response<ResponseBody>> getAPPVersion(@QueryMap Map<String, Object> params);


    @Multipart
    @POST("homework/answer/commitSpeakAnswer")
    Observable<Response<ResponseBody>> submitWork(@PartMap Map<String, RequestBody> params);

    /**
     * 非凡学习
     * 金牌老师列表
     *
     * @return
     */
    @FormUrlEncoded
    @POST("MemberShip/GetUserMakeModel")
    Observable<Response<ResponseBody>> getGoldLectureList(@Header("X-FANCY-SIGN") String sign, @Header("X-FANCY-APPVERSION") String appversion, @FieldMap Map<String, String> paramsMap);


    /**
     * 非凡学习获取系统时间
     *
     * @param appversion
     * @param params
     * @return
     */
    @FormUrlEncoded
    @POST("AppConfig/CurrentTime")
    Observable<Response<ResponseBody>> getSystemTime(@Header("X-FANCY-SIGN") String sign, @Header("X-FANCY-APPVERSION") String appversion, @FieldMap Map<String, String> params);


    /**
     * 金牌老师个人信息
     *
     * @param sign
     * @param appversion
     * @param params
     * @return
     */
    @FormUrlEncoded
    @POST("UserHomepage/Get-UserInfo")
    Observable<Response<ResponseBody>> getUserData(@Header("X-FANCY-SIGN") String sign, @Header("X-FANCY-APPVERSION") String appversion, @FieldMap Map<String, String> params);

    /**
     * 金牌老师故事列表
     *
     * @param sign
     * @param appversion
     * @param params
     * @return
     */
    @FormUrlEncoded
    @POST("taleteling/get-list-Recommended-fid")
    Observable<Response<ResponseBody>> getListRecommend(@Header("X-FANCY-SIGN") String sign, @Header("X-FANCY-APPVERSION") String appversion, @FieldMap Map<String, String> params);

    /**
     * 获取非凡学习配置信息
     *
     * @param sign
     * @param appversion
     * @param params
     * @return
     */
    @FormUrlEncoded
    @POST("AppConfig/Normal")
    Observable<Response<ResponseBody>> getAppConfig(@Header("X-FANCY-SIGN") String sign, @Header("X-FANCY-APPVERSION") String appversion, @FieldMap Map<String, String> params);


    /**
     * 金牌老师添加播放次数
     *
     * @param sign
     * @param appversion
     * @param params
     * @return
     */
    @FormUrlEncoded
    @POST("taleteling/play")
    Observable<Response<ResponseBody>> addStoryRadioSetPlayCount(@Header("X-FANCY-SIGN") String sign, @Header("X-FANCY-APPVERSION") String appversion, @FieldMap Map<String, String> params);

    /**
     * 教辅平台 获取作业列表
     */
    @FormUrlEncoded
    @POST("homework/objectQuestion/listHomePackage")
    Observable<Response<ResponseBody>> listHomePackage(@FieldMap Map<String, Object> map);

    /**
     * 教辅平台 做作业进度
     */
    @FormUrlEncoded
    @POST("homework/objectQuestion/findStudentHomeworktSatistics")
    Observable<Response<ResponseBody>> listHomeSstatics(@FieldMap Map<String, Object> map);

    /**
     * 教辅平台 作业报告
     *
     * @param map
     * @return
     */
    @FormUrlEncoded
    @POST("homework/objectQuestion/findStudentHomeworkReportSatistics")
    Observable<Response<ResponseBody>> listStaticsReport(@FieldMap Map<String, Object> map);


    /**
     * 教辅平台 错题中心--为订正记录
     *
     * @param map
     * @return
     */
    @FormUrlEncoded
    @POST("homework/objectQuestion/countUnCorrect")
    Observable<Response<ResponseBody>> countUnCorrect(@FieldMap Map<String, Object> map);


    @FormUrlEncoded
    @POST("homework/class/deleteClass")
    Observable<Response<ResponseBody>> deleteClass(@FieldMap Map<String, Object> map);

    @FormUrlEncoded
    @POST("homework/teacher/delTeacherFromClass")
    Observable<Response<ResponseBody>> delTeacherFromClas(@FieldMap Map<String, Object> map);

    @FormUrlEncoded
    @POST("homework/class/checkClassExist")
    Observable<Response<ResponseBody>> checkClass(@FieldMap Map<String, Object> map);


    @FormUrlEncoded
    @POST("homework/class/checkCreateClassNum.json")
    Observable<Response<ResponseBody>> checkCreateClassNum(@FieldMap Map<String, Object> map);

    /**
     * 教辅平台 错题中心-已订正，未订正数组
     *
     * @param map
     * @return
     */
    @FormUrlEncoded
    @POST("homework/objectQuestion/listStudentHomeworkQuestionId.json")
    Observable<Response<ResponseBody>> listCorrectState(@FieldMap Map<String, Object> map);

    /**
     * 教辅平台 错题中心- 错题分类 根据类目ID
     *
     * @param map
     * @return
     */
    @FormUrlEncoded
    @POST("homework/objectQuestion/listQuestionIdByConstructId")
    Observable<Response<ResponseBody>> listConstructId(@FieldMap Map<String, Object> map);

    /**
     * 教辅平台 根据id获取作业包
     *
     * @param map
     * @return
     */
    @FormUrlEncoded
    @POST("homework/objectQuestion/downLoadHomeworkByHid")
    Observable<Response<ResponseBody>> downLoadHomeWorkNyId(@FieldMap Map<String, Object> map);


    /**
     * 教辅平台 -- 加入班级
     *
     * @param map
     * @return
     */
    @FormUrlEncoded
    @POST("homework/class/joinClassForStu")
    Observable<Response<ResponseBody>> joinClassForStudent(@FieldMap Map<String, Object> map);

    /**
     * 教辅平台--提交答案
     *
     * @return
     */
    @POST("homework/answer/commitHomeworkAnswer")
    Observable<Response<ResponseBody>> commitHomeWorkAnswer(@Body RequestBody route);


    /**
     * 获取班级ID
     *
     * @return
     */
    @POST("homework/class/listClassOfStudent")
    Observable<Response<ResponseBody>> getClassId();

    /**
     * 完成作业时调用接口
     *
     * @return
     */
    @FormUrlEncoded
    @POST("homework/objectQuestion/completeHomework")
    Observable<Response<ResponseBody>> completeHomework(@FieldMap Map<String, Object> map);


    /**
     * 错题分类接口
     *
     * @return
     */
    @FormUrlEncoded
    @POST("homework/objectQuestion/listHomeworkContructSatisticsByStudentId")
    Observable<Response<ResponseBody>> listErrorStatics(@FieldMap Map<String, Object> map);

    /**
     * 教辅平台 --作业报告 获取用户提交的客观题答案
     *
     * @param map
     * @return
     */
    @FormUrlEncoded
    @POST("homework/answer/getHomeworkAnswer")
    Observable<Response<ResponseBody>> getHomeAnswer(@FieldMap Map<String, Object> map);

    /**
     * 教辅平台 --完成作业 获取单元列表
     */
    @FormUrlEncoded
    @POST("homework/class/listUnitByClass")
    Observable<Response<ResponseBody>> getUnitList(@FieldMap Map<String, Object> map);

    /**
     * 获取学生所在班级列表
     */
    @FormUrlEncoded
    @POST("homework/class/listClassOfStudent")
    Observable<Response<ResponseBody>> listClassOfStudent(@FieldMap Map<String, Object> map);

    /**
     * 主观题-题包列表接口
     */
    @FormUrlEncoded
    @POST("homework/subjectQuestion/listSpeakPackage")
    Observable<Response<ResponseBody>> listSpeakPackage(@FieldMap Map<String, Object> map);

    /**
     * 主观题-题包列表接口
     */
    @FormUrlEncoded
    @POST("homework/subjectQuestion/downLoadSpeakPackageByPid")
    Observable<Response<ResponseBody>> speakPackageDetail(@FieldMap Map<String, Object> map);

    /**
     * 主观题-获取已发布 作业
     */
    @FormUrlEncoded
    @POST("homework/subjectQuestion/listCommitedSpeaking")
    Observable<Response<ResponseBody>> releaseSpeaking(@FieldMap Map<String, Object> map);

    /**
     * 主观题-获取已发布 作业
     */
    @FormUrlEncoded
    @POST("homework/subjectQuestion/downLoadSubjectQuestionByQid")
    Observable<Response<ResponseBody>> releaseDetail(@FieldMap Map<String, Object> map);

    /**
     * 客观题--获取首次完成作业数量
     */
    @FormUrlEncoded
    @POST("homework/objectQuestion/countDoneHomeworkDetail")
    Observable<Response<ResponseBody>> countDoneHomeworkDetail(@FieldMap Map<String, Object> map);


    /**
     * 客观题--获取首次完成作业数量
     */
    @FormUrlEncoded
    @POST("homework/objectQuestion/checkQuestionIsDone")
    Observable<Response<ResponseBody>> checkQuestionIsDone(@FieldMap Map<String, Object> map);


    /**
     * 萝卜排行榜
     *
     * @param map
     * @return
     */
    @FormUrlEncoded
    @POST("homework/class/listRadishRank")
    Observable<Response<ResponseBody>> listRadishRank(@FieldMap Map<String, Object> map);

    @FormUrlEncoded
    @POST("homework/student/getStudentVO")
    Observable<Response<ResponseBody>> getRadishRank(@FieldMap Map<String, Object> map);

    /**
     * 错题中心-错题分类，未订正 提交接口
     *
     * @return
     */
    @FormUrlEncoded
    @POST("homework/objectQuestion/correctErrorQuestion")
    Observable<Response<ResponseBody>> correctErrorQuestion(@FieldMap Map<String, Object> map);

    /**
     * 错题中心-根据questionids来获取错题数组
     */
    @FormUrlEncoded
    @POST("homework/objectQuestion/downLoadHomeworkByQids.json")
    Observable<Response<ResponseBody>> downLoadHomeworkByQids(@FieldMap Map<String, Object> map);

    /**
     * 错题中心单元列表
     *
     * @param map
     * @return
     */
    @FormUrlEncoded
    @POST("homework/objectQuestion/listHomeworkInErrorQuestion")
    Observable<Response<ResponseBody>> listHomeworkError(@FieldMap Map<String, Object> map);


    /**
     * 获取班级
     *
     * @return
     */
    @POST("homework/schoolGroup/listSchoolInfo.json")
    Observable<Response<ResponseBody>> getSchoolGroup();

    /**
     * 获取教材
     *
     * @param map
     * @return
     */
    @FormUrlEncoded
    @POST("homework/schoolGroup/listLessonOfSchool.json")
    Observable<Response<ResponseBody>> getListLessonOfSchool(@FieldMap Map<String, Object> map);

    /**
     * 创建班级
     *
     * @return
     */
    @POST("homework/class/editClass")
    Observable<Response<ResponseBody>> creatClass(@Body RequestBody body);

    /**
     * 创建班级
     *
     * @param map
     * @return
     */
    @FormUrlEncoded
    @POST("homework/class/listLessonOfSchool.json")
    Observable<Response<ResponseBody>> getListClass(@FieldMap Map<String, Object> map);

    /**
     * 创建班级
     *
     * @param map
     * @return
     */
    @FormUrlEncoded
    @POST("homework/objectQuestion/listHomeworkIndex")
    Observable<Response<ResponseBody>> getListWork(@FieldMap Map<String, Object> map);

    @FormUrlEncoded
    @POST("homework/subjectQuestion/listStudentSpeakDoneDetail")
    Observable<Response<ResponseBody>> everyDayPreView(@FieldMap Map<String, Object> map);

    /**
     * 获取教师列表
     *
     * @param map
     * @return
     */
    @FormUrlEncoded
    @POST("homework/teacher/listTeacher.json")
    Observable<Response<ResponseBody>> getTeacherList(@FieldMap Map<String, Object> map);

    /**
     * @param map
     * @return
     */
    @FormUrlEncoded
    @POST("homework/student/listStudent.json")
    Observable<Response<ResponseBody>> getStudentList(@FieldMap Map<String, Object> map);

    /**
     * @param map
     * @return
     */
    @FormUrlEncoded
    @POST("homework/student/addStudent.json")
    Observable<Response<ResponseBody>> addStudent(@FieldMap Map<String, Object> map);

    /**
     * @param map
     * @return
     */
    @FormUrlEncoded
    @POST("homework/student/editStudent.json")
    Observable<Response<ResponseBody>> editStudent(@FieldMap Map<String, Object> map);

    /**
     * @param map
     * @return
     */
    @FormUrlEncoded
    @POST("homework/student/removeStudent.json")
    Observable<Response<ResponseBody>> removeStudent(@FieldMap Map<String, Object> map);


    /**
     * @param map
     * @return
     */
    @FormUrlEncoded
    @POST("homework/teacher/swapIdentify")
    Observable<Response<ResponseBody>> swapIdentify(@FieldMap Map<String, Object> map);

    /**
     * @param map
     * @return
     */
    @FormUrlEncoded
    @POST("homework/student/findStudent.json")
    Observable<Response<ResponseBody>> queryStudent(@FieldMap Map<String, Object> map);

    /**
     * @param map
     * @return
     */
    @FormUrlEncoded
    @POST("homework/teacher/addTeacher.json")
    Observable<Response<ResponseBody>> addTeacher(@FieldMap Map<String, Object> map);

    /**
     * @param map
     * @return
     */
    @FormUrlEncoded
    @POST("homework/teacher/findTeacher.json")
    Observable<Response<ResponseBody>> queryTeacher(@FieldMap Map<String, Object> map);


    /**
     * 学生完成作业答案以及对错的列表
     *
     * @param map
     * @return
     */
    @FormUrlEncoded
    @POST("homework/objectQuestion/listHomeworkByClass")
    Observable<Response<ResponseBody>> listHomeworkByClass(@FieldMap Map<String, Object> map);

    /**
     * 获取作业报告
     */
//    @FormUrlEncoded
    @POST("homework/answer/listStudentHomeworkAnswer")
    Observable<Response<ResponseBody>> listStudentHomeworkAnswer(@Body RequestBody route);

    @FormUrlEncoded
    @POST("homework/objectQuestion/assigStudentHomework.json")
    Observable<Response<ResponseBody>> assigStudentHomework(@FieldMap Map<String, Object> route);

    @FormUrlEncoded
    @POST("homework/subjectQuestion/urgeStudentSpeak")
    Observable<Response<ResponseBody>> urgeStudentSpeak(@FieldMap Map<String, Object> route);

    /**
     * 教师端-报告详情
     */
    @FormUrlEncoded
    @POST("homework/objectQuestion/listStudentHomework")
    Observable<Response<ResponseBody>> cartoonListStudentHomework(@FieldMap Map<String, Object> map);

    /**
     * 教师端- 返回作业的统计数据（选择作业包预览）
     *
     * @param map
     * @return
     */
    @FormUrlEncoded
    @POST("homework/objectQuestion/listHomeworkStatistic")
    Observable<Response<ResponseBody>> cartoonListHomeworkStatistic(@FieldMap Map<String, Object> map);

    /**
     * 教师端布置作业
     *
     * @param map
     * @return
     */
    @FormUrlEncoded
    @POST("homework/objectQuestion/assignHomework")
    Observable<Response<ResponseBody>> cartoonAssignHomework(@FieldMap Map<String, Object> map);

    /**
     * 教师端通过作业包id下载作业宝
     */
    @FormUrlEncoded
    @POST("homework/objectQuestion/downLoadHomeworkById")
    Observable<Response<ResponseBody>> cartoonTeacherDownLoadHomeworkById(@FieldMap Map<String, Object> map);

    /**
     * 教师端通过作业包id下载作业宝
     */
    @FormUrlEncoded
    @POST("homework/subjectQuestion/listStudentSpeak")
    Observable<Response<ResponseBody>> listStudentSpeak(@FieldMap Map<String, Object> map);

    /**
     * 教师端通过作业包id下载作业宝
     */
    @FormUrlEncoded
    @POST("homework/subjectQuestion/listStudentSpeakDoneDetail")
    Observable<Response<ResponseBody>> listStudentSpeakDoneDetail(@FieldMap Map<String, Object> map);

    /**
     * 教师端通过作业包id下载作业宝
     */
    @FormUrlEncoded
    @POST("homework/teacher/listWeekAndTotalStatistic")
    Observable<Response<ResponseBody>> reportHomeWork(@FieldMap Map<String, Object> map);

}
